/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.restaurant.domain;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author root
 */
@Entity
@Table(name = "discountype")
@XmlRootElement (name = "discountype")
@NamedQueries({
    @NamedQuery(name = "Discountype.findAll", query = "SELECT d FROM Discountype d"),
    @NamedQuery(name = "Discountype.findByDiscounttypeID", query = "SELECT d FROM Discountype d WHERE d.discounttypeID = :discounttypeID"),
    @NamedQuery(name = "Discountype.findByDiscountname", query = "SELECT d FROM Discountype d WHERE d.discountname = :discountname"),
    @NamedQuery(name = "Discountype.findByIsdeleted", query = "SELECT d FROM Discountype d WHERE d.isdeleted = :isdeleted")})
public class Discountype implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "DiscounttypeID")
    private Long discounttypeID;
    @Column(name = "discountname")
    private String discountname;
    @Basic(optional = false)
    @Column(name = "amount")
    private Double amount;
    @Column(name = "isdeleted")
    private boolean isdeleted;
    @JoinColumn(name = "discountmode_DiscountModeID", referencedColumnName = "DiscountModeID")
    @ManyToOne(optional = false)
    private Discountmode discountmode;

    public Discountype() {
    }

    public Discountype(Long discounttypeID) {
        this.discounttypeID = discounttypeID;
    }

    public Discountype(Long discounttypeID, boolean isdeleted) {
        this.discounttypeID = discounttypeID;
        this.isdeleted = isdeleted;
    }

    public Long getDiscounttypeID() {
        return discounttypeID;
    }

    public void setDiscounttypeID(Long discounttypeID) {
        this.discounttypeID = discounttypeID;
    }

    public String getDiscountname() {
        return discountname;
    }

    public void setDiscountname(String discountname) {
        this.discountname = discountname;
    }

    public boolean getIsdeleted() {
        return isdeleted;
    }

    public void setIsdeleted(boolean isdeleted) {
        this.isdeleted = isdeleted;
    }

    public Discountmode getDiscountmode() {
        return discountmode;
    }

    public void setDiscountmode(Discountmode discountmode) {
        this.discountmode = discountmode;
    }
    
    public Double getAmount() {
		return amount;
	}

	public void setAmount(Double amount) {
		this.amount = amount;
	}

	@Override
    public int hashCode() {
        int hash = 0;
        hash += (discounttypeID != null ? discounttypeID.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Discountype)) {
            return false;
        }
        Discountype other = (Discountype) object;
        if ((this.discounttypeID == null && other.discounttypeID != null) || (this.discounttypeID != null && !this.discounttypeID.equals(other.discounttypeID))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.restaurant.domain.Discountype[discounttypeID=" + discounttypeID + "]";
    }

}
